package com.ibm.moa.outmail;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class LoginActivity extends Activity implements OnClickListener {
	private Button loginBT;
	private EditText loginName, loginPassWord;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.login);
		loginName = (EditText) findViewById(R.id.moa_login_edit_name);
		loginPassWord = (EditText) findViewById(R.id.moa_login_edit_pwd);
		loginBT = (Button) findViewById(R.id.moa_login_imgbtn_login);
		loginBT.setOnClickListener(this);
//		loginName.setText("zhaoyonggang");
//		loginPassWord.setText(MailApplication.passWord);
//		loginPassWord.setText("Zx,.1231");

	}

	@Override
	public void onClick(View v) {
		if (v == loginBT) {
			// if(!"".equals(loginName.getText().toString().trim())){
			// MailApplication.userCode = loginName.getText().toString().trim();
			// MailApplication.passWord = loginPassWord.getText().toString().trim();
			// }else{
			// Toast.makeText(LoginActivity.this, "账号不能为空", 1).show();
			// return;
			// }
			Intent intent = new Intent(LoginActivity.this, HomeActivity.class);
			intent.putExtra("userName", loginName.getText().toString().trim());
			intent.putExtra("password", loginPassWord.getText().toString().trim());
			startActivity(intent);
			finish();

			// Intent intent = new Intent("com.ibm.moa.contact.select");
			// intent.putExtra("userName", "moa");
			// startActivityForResult(intent, 1);
		}

	}

}
